home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
sr
/
info.lha
/
info-sr.1992
/
000015_olsson@cs.ucdavis.edu _Thu Oct 8 00:01:38 1992.msg
< prev
next >
Wrap
Text File
|
1993-07-24
|
2KB
|
62 lines
Received: from ivy.cs.ucdavis.edu by optima.cs.arizona.edu (5.65c/15) via SMTP
id AA16078; Thu, 8 Oct 1992 00:01:58 MST
Received: by ivy.cs.ucdavis.edu (5.57/UCD.CS.2.0)
id AA22242; Thu, 8 Oct 92 00:01:38 -0700
Date: Thu, 8 Oct 92 00:01:38 -0700
From: olsson@cs.ucdavis.edu (Ron Olsson)
Message-Id: <9210080701.AA22242@ivy.cs.ucdavis.edu>
To: timbomb@cs.uq.oz.au
Cc: info-sr@cs.arizona.edu
In-Reply-To: Tim Mansfield's message of Thu, 08 Oct 92 14:43:46 +1000 <9210080443.AA06080@uqcspe.cs.uq.oz.au>
Subject: Possibly dumb crash question...
The problem is in the code
proc bank() returns p
op bankput: put
var pget: cap get
p:= bankput
reply
in bankput(banktest, pget) ->
write("banktest", banktest)
ni
send pget(5) # memory fault here
end
The input statement's two parameters -- banktest and pget -- have
values from the invocation of bankput; their scope is the input
statement; they disappear at the ni. The value of variable pget
(different from parameter pget) is unchanged by the input statement.
Since variable pget was never initialized, its value is unknown, so
the send invocation is erroneous. By chance, the particular (garbage)
value of pget is causing the problem you saw. (More typically, it
would cause a "null invocation" error.)
You probably meant to code the above as
proc bank() returns p
op bankput: put
#### no longer needed: var pget: cap get
p:= bankput
reply
in bankput(banktest, pget) ->
write("banktest", banktest)
send pget(5)
ni
end
or as
proc bank() returns p
op bankput: put
var pget: cap get
var banktest: int #### new decl
p:= bankput
reply
receive bankput(banktest, pget)
write("banktest", banktest)
send pget(5)
end